
import java.util.Scanner;

public class Switchone {
    public static void main(String[] args) {
        try (Scanner scanner = new Scanner(System.in)) {
            System.out.println("请输入年份：");
            int year = scanner.nextInt();
            System.out.println("请输入月份：");
            int month = scanner.nextInt();
            System.out.println("请输入日期：");
            int day = scanner.nextInt();

            int days = 0;
            int[] months = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

            if (isLeapYear(year)) {
                months[1] = 29;
            }

            for (int i = 0; i < month - 1; i++) {
                days += months[i];
            }
            days += day;

            System.out.println("这一天是当年的第 " + days + " 天");
        }

    }

    public static boolean isLeapYear(int year) {
        return (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
    }
}
